package com.bjpowernode;

import com.bjpowernode.service.BuyGoodsService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class MyApplication {

    public static void main(String[] args) {
        String config="applicationContext.xml";
        ApplicationContext ctx = new ClassPathXmlApplicationContext(config);
        //从容器获取service
        BuyGoodsService service = (BuyGoodsService) ctx.getBean("buyService");

        //com.sun.proxy.$Proxy12
        System.out.println("service是代理："+service.getClass().getName());
        //调用方法
        service.test();
    }

}
